home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.3 KB | 114 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWRecShp.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWRECSHP_H
- #define FWRECSHP_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CGraphicContext;
-
- //=======================================================================================
- // class FW_CRectShape
- //=======================================================================================
-
- class FW_CLASS_ATTR FW_CRectShape : public FW_CBoundedShape
- {
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CRectShape();
- FW_CRectShape(const FW_CRect& rect,
- FW_ERenderVerbs renderVerb,
- const FW_PInk& ink = FW_kNormalInk,
- const FW_PStyle& style = FW_kNormalStyle);
-
- FW_CRectShape(const FW_CRectShape& other);
- FW_CRectShape(FW_CReadableStream& archive);
-
- virtual ~ FW_CRectShape();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Hit Testing -----
- virtual FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_CFixed tolerance) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Geometry -----
- void SetGeometry(const FW_CRect& rect);
- void GetGeometry(FW_CRect& rect) const;
-
- // ----- Static rendering method -----
- static void RenderRect(FW_CGraphicContext& gc,
- const FW_CRect& rect,
- FW_ERenderVerbs renderVerb,
- const FW_PInk& ink = FW_kNormalInk,
- const FW_PStyle& style = FW_kNormalStyle);
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& archive);
-
- };
-
- //=======================================================================================
- // Inlines
- //=======================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CRectShape::GetGeometry
- //----------------------------------------------------------------------------------------
- inline void FW_CRectShape::GetGeometry(FW_CRect& rect) const
- {
- rect = fRect;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CRectShape::SetGeometry
- //----------------------------------------------------------------------------------------
- inline void FW_CRectShape::SetGeometry(const FW_CRect& rect)
- {
- fRect = rect;
- }
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-